function a=subsasgn(a,s,x)

  sd = s;
  sd.subs = {s.subs{:},':'};

  
  switch s.type
   case '()'
    if ~isa(x,'deriv1f')
      a.v = subsasgn(a.v,s,x);
      a.d = subsasgn(a.d,sd,0);
    else
      a.v = subsasgn(a.v,s,x.v);
      a.d = subsasgn(a.d,sd,x.d);
    end
   otherwise
    error('wrong index type for_ deriv1f');
  end
